package com.java.playingcard;

import java.util.Arrays;
public class Cards {
	public static void main(String[] args) {
		int[] cards = new int[54];
		for (int i = 0; i < cards.length; i++) {
			cards[i] = i + 1;
		}

		// int [] player1 = new int[17];
		// int [] player2 = new int[17];
		// int [] player3 = new int[17];
		int[][] players = new int[3][17];
		for (int j = 0; j < players.length; j++) {
			for (int i = 0; i < players[j].length;) {
				int ram = (int) (Math.random() * 54);
				int card = cards[ram];
				if (card >= 0) {
					cards[ram] = -1;
					players[j][i] = card;
					i++;
				}
			}
			System.out.println("Player" + (j + 1) + Arrays.toString(players[j]));
		}				
	
				/*for (int i = 0 ;i < player2.length ; ) {
					int ram = (int) (Math.random()*54);
					int card = cards[ram];
					if (card >= 0) {
						cards[ram] = -1;
		        player2[i] = card;
						i++;
					}
				}
	
				for (int i = 0 ;i < player3.length ; ) {
					int ram = (int) (Math.random()*54);
					int card = cards[ram];
					if (card >= 0) {
						cards[ram] = -1;
		        player3[i] = card;
						i++;
					}
				}
				for (int i = 0 ;i < player1.length ;i++){
				  System.out.print(player1[i] + ",");
				}
				System.out.println();
				for (int i = 0 ;i < player2.length ;i++){
				  System.out.print(player2[i] + ",");
				}
				System.out.println();
				for (int i = 0 ;i < player3.length ;i++){
				  System.out.print(player3[i] + ",");
				}
				System.out.println(); 
		      
				System.out.println(Arrays.toString(player1));
				System.out.println(Arrays.toString(player2));
				System.out.println(Arrays.toString(player3));  */
		    
		System.out.print("底牌为：");
		for (int i = 0; i < cards.length; i++) {
			if (cards[i] != -1) {
				System.out.print(cards[i] + ",");
			}
		}
	}
}

